<?php require_once ('admin.php');?>
<?php 
if(isset($_GET['i']) && isset($_GET['type'])){
    if(isset($_POST['delete'])){
	DealFlight::delete($_GET['i']);
	
	if($_GET['type'] == DealFlight::DEAL){
	    wp_redirect('deals-list.php');
	}
        else if($_GET['type']=='booking'){
            DealFlightBooking::DeleteBooking($_GET[$i]);
            wp_redirect('manager-booking.php');
        }
        else{	    
		wp_redirect('flights-list.php');	    
	}
        
    }
    ?>

<?php include_once ('./admin-header.php');?>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">

<!-- Optional theme -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">

<!-- Latest compiled and minified JavaScript -->
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>

<form method="post" action="">
    <div class="alert alert-danger">
	Do your want to delete this item?
	<input type="submit" name="delete" value="Yes" class="btn btn-primary"/>    
	
	<?php if($_GET['type'] == DealFlight::DEAL){?>
	    <a href="deals-list.php" class="btn btn-default">No</a>
	<?php }
         else if($_GET['type'] == 'booking'){
         ?> 
            <a href="manager-list.php" class="btn btn-default">No</a>
            
            <?php
         }
        else{?>
	    	    
		<a href="flights-list.php" class="btn btn-default">No</a>
		<?php
	    }
          
	
?>
    </div>
</form>
<?php }else{
     wp_redirect('404.php');
}
?>
<?php include('./admin-footer.php');?>
